home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / fsp-2.7 / fsp-2 / fsp / configure < prev    next >
Encoding:
Text File  |  1993-05-21  |  33.5 KB  |  1,244 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      *) ;;
  74.     esac
  75.   fi
  76. done
  77.  
  78. trap 'rm -f conftest* core; exit 1' 1 3 15
  79.  
  80. rm -f conftest*
  81. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  82.  
  83. # A filename unique to this package, relative to the directory that
  84. # configure is in, which we can look for to find out if srcdir is correct.
  85. unique_file=Makefile.in
  86.  
  87. # Find the source files, if location was not specified.
  88. if test -z "$srcdir"; then
  89.   srcdirdefaulted=yes
  90.   # Try the directory containing this script, then `..'.
  91.   prog=$0
  92.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  93.   test "X$confdir" = "X$prog" && confdir=.
  94.   srcdir=$confdir
  95.   if test ! -r $srcdir/$unique_file; then
  96.     srcdir=..
  97.   fi
  98. fi
  99. if test ! -r $srcdir/$unique_file; then
  100.   if test x$srcdirdefaulted = xyes; then
  101.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  102.   else
  103.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  104.   fi
  105.   exit 1
  106. fi
  107. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  108. # But we can't avoid them for `..', to make subdirectories work.
  109. case $srcdir in
  110.   .|/*|~*) ;;
  111.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  112. esac
  113.  
  114.  
  115. echo checking for ln -s
  116. rm -f conftestdata
  117. if ln -s X conftestdata 2>/dev/null
  118. then
  119.   rm -f conftestdata
  120.   LN_S="ln -s"
  121. else
  122.   LN_S=ln
  123. fi
  124.  
  125.  
  126. if test -z "$CC"; then
  127.   echo checking for gcc
  128.   saveifs="$IFS"; IFS="${IFS}:"
  129.   for dir in $PATH; do
  130.     test -z "$dir" && dir=.
  131.     if test -f $dir/gcc; then
  132.       CC="gcc"
  133.       break
  134.     fi
  135.   done
  136.   IFS="$saveifs"
  137. fi
  138. test -z "$CC" && CC="cc"
  139.  
  140. # Find out if we are using GNU C, under whatever name.
  141. cat > conftest.c <<EOF
  142. #ifdef __GNUC__
  143.   yes
  144. #endif
  145. EOF
  146. ${CC-cc} -E conftest.c > conftest.out 2>&1
  147. if egrep yes conftest.out >/dev/null 2>&1; then
  148.   GCC=1 # For later tests.
  149. fi
  150. rm -f conftest*
  151.  
  152. echo checking for POSIXized ISC
  153. if test -d /etc/conf/kconfig.d &&
  154.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  155. then
  156.   ISC=1 # If later tests want to check for ISC.
  157.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  158. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  159. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  160. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  161. "
  162.   if test -n "$GCC"; then
  163.     CC="$CC -posix"
  164.   else
  165.     CC="$CC -Xp"
  166.   fi
  167. fi
  168.  
  169. echo checking for DYNIX/ptx 
  170. echo checking how to run the C preprocessor
  171. if test -z "$CPP"; then
  172.   CPP='${CC-cc} -E'
  173.   cat > conftest.c <<EOF
  174. #include <stdio.h>
  175. EOF
  176. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  177. if test -z "$err"; then
  178.   :
  179. else
  180.   CPP=/lib/cpp
  181. fi
  182. rm -f conftest*
  183. fi
  184.  
  185. cat > conftest.c <<EOF
  186. #if defined(_SEQUENT_)
  187.   yes
  188. #endif
  189.  
  190. EOF
  191. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  192. if grep "yes" conftest.out >/dev/null 2>&1; then
  193.   SEQUENT=1
  194. fi
  195. rm -f conftest*
  196.  
  197. if test -n "$SEQUENT"; then
  198. EX_LIBS="-lsocket -linet -lnsl -lseq"
  199. PARALLEL_MAKE='\&'
  200. CC='cc'
  201. GCC=
  202. echo You"'"re on Sequent.. Using cc and parallel make
  203. fi
  204. echo checking for SunOS 5.1
  205. cat > conftest.c <<EOF
  206. #if defined(SVR4) && defined(SPARC)
  207.   yes
  208. #endif
  209.  
  210. EOF
  211. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  212. if grep "yes" conftest.out >/dev/null 2>&1; then
  213.   SUNOS51=1
  214. fi
  215. rm -f conftest*
  216.  
  217. if test -n "$SUNOS51"; then
  218. EX_LIBS="-lsockect -lnsl"
  219. fi
  220.  
  221.  
  222. echo checking for AIX
  223. cat > conftest.c <<EOF
  224. #ifdef _AIX
  225.   yes
  226. #endif
  227.  
  228. EOF
  229. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  230. if egrep "yes" conftest.out >/dev/null 2>&1; then
  231.   DEFS="$DEFS -D_ALL_SOURCE=1"
  232. SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD}
  233. \${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD}
  234. \${SEDeA}_ALL_SOURCE\${SEDeB}_ALL_SOURCE\${SEDeC}1\${SEDeD}
  235. "
  236. fi
  237. rm -f conftest*
  238.  
  239.  
  240. echo checking for DGUX
  241. cat > conftest.c <<EOF
  242. #if defined(DGUX)
  243.   yes
  244. #endif
  245. EOF
  246. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  247. if grep "yes" conftest.out >/dev/null 2>&1; then
  248.   DGUX=1
  249. fi
  250. rm -f conftest*
  251.  
  252. # Make sure to not get the incompatible SysV /etc/install and
  253. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  254. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  255. # or the AFS install, which mishandles nonexistent args.  (Sigh.)
  256. if test -z "$INSTALL"; then
  257.   echo checking for install
  258.   saveifs="$IFS"; IFS="${IFS}:"
  259.   for dir in $PATH; do
  260.     test -z "$dir" && dir=.
  261.     case $dir in
  262.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  263.     *)
  264.       if test -f $dir/install; then
  265.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  266.       : # AIX
  267.     else
  268.       INSTALL="$dir/install -c"
  269.       INSTALL_PROGRAM='$(INSTALL)'
  270.       INSTALL_DATA='$(INSTALL) -m 644'
  271.       break
  272.     fi
  273.       fi
  274.       ;;
  275.     esac
  276.   done
  277.   IFS="$saveifs"
  278. fi
  279. INSTALL=${INSTALL-cp}
  280. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  281. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  282.  
  283. if test -z "$RANLIB"; then
  284.   echo checking for ranlib
  285.   saveifs="$IFS"; IFS="${IFS}:"
  286.   for dir in $PATH; do
  287.     test -z "$dir" && dir=.
  288.     if test -f $dir/ranlib; then
  289.       RANLIB="ranlib"
  290.       break
  291.     fi
  292.   done
  293.   IFS="$saveifs"
  294. fi
  295. test -z "$RANLIB" && RANLIB="@:"
  296.  
  297. echo checking for directory library header
  298. echo checking for dirent.h
  299. cat > conftest.c <<EOF
  300. #include <dirent.h>
  301. EOF
  302. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  303. if test -z "$err"; then
  304.   DEFS="$DEFS -DDIRENT=1"
  305. SEDDEFS="${SEDDEFS}\${SEDdA}DIRENT\${SEDdB}DIRENT\${SEDdC}1\${SEDdD}
  306. \${SEDuA}DIRENT\${SEDuB}DIRENT\${SEDuC}1\${SEDuD}
  307. \${SEDeA}DIRENT\${SEDeB}DIRENT\${SEDeC}1\${SEDeD}
  308. " dirheader=dirent.h
  309. fi
  310. rm -f conftest*
  311.  
  312. if test -z "$dirheader"; then
  313. echo checking for sys/ndir.h
  314. cat > conftest.c <<EOF
  315. #include <sys/ndir.h>
  316. EOF
  317. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  318. if test -z "$err"; then
  319.   DEFS="$DEFS -DSYSNDIR=1"
  320. SEDDEFS="${SEDDEFS}\${SEDdA}SYSNDIR\${SEDdB}SYSNDIR\${SEDdC}1\${SEDdD}
  321. \${SEDuA}SYSNDIR\${SEDuB}SYSNDIR\${SEDuC}1\${SEDuD}
  322. \${SEDeA}SYSNDIR\${SEDeB}SYSNDIR\${SEDeC}1\${SEDeD}
  323. " dirheader=sys/ndir.h
  324. fi
  325. rm -f conftest*
  326.  
  327. fi
  328. if test -z "$dirheader"; then
  329. echo checking for sys/dir.h
  330. cat > conftest.c <<EOF
  331. #include <sys/dir.h>
  332. EOF
  333. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  334. if test -z "$err"; then
  335.   DEFS="$DEFS -DSYSDIR=1"
  336. SEDDEFS="${SEDDEFS}\${SEDdA}SYSDIR\${SEDdB}SYSDIR\${SEDdC}1\${SEDdD}
  337. \${SEDuA}SYSDIR\${SEDuB}SYSDIR\${SEDuC}1\${SEDuD}
  338. \${SEDeA}SYSDIR\${SEDeB}SYSDIR\${SEDeC}1\${SEDeD}
  339. " dirheader=sys/dir.h
  340. fi
  341. rm -f conftest*
  342.  
  343. fi
  344. if test -z "$dirheader"; then
  345. echo checking for ndir.h
  346. cat > conftest.c <<EOF
  347. #include <ndir.h>
  348. EOF
  349. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  350. if test -z "$err"; then
  351.   DEFS="$DEFS -DNDIR=1"
  352. SEDDEFS="${SEDDEFS}\${SEDdA}NDIR\${SEDdB}NDIR\${SEDdC}1\${SEDdD}
  353. \${SEDuA}NDIR\${SEDuB}NDIR\${SEDuC}1\${SEDuD}
  354. \${SEDeA}NDIR\${SEDeB}NDIR\${SEDeC}1\${SEDeD}
  355. " dirheader=ndir.h
  356. fi
  357. rm -f conftest*
  358.  
  359. fi
  360.  
  361. echo checking for closedir return value
  362. cat > conftest.c <<EOF
  363. #include <sys/types.h>
  364. #include <$dirheader>
  365. int closedir(); main() { exit(0); }
  366. EOF
  367. eval $compile
  368. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  369.   :
  370. else
  371.   DEFS="$DEFS -DVOID_CLOSEDIR=1"
  372. SEDDEFS="${SEDDEFS}\${SEDdA}VOID_CLOSEDIR\${SEDdB}VOID_CLOSEDIR\${SEDdC}1\${SEDdD}
  373. \${SEDuA}VOID_CLOSEDIR\${SEDuB}VOID_CLOSEDIR\${SEDuC}1\${SEDuD}
  374. \${SEDeA}VOID_CLOSEDIR\${SEDeB}VOID_CLOSEDIR\${SEDeC}1\${SEDeD}
  375. "
  376. fi
  377. rm -f conftest*
  378.  
  379. echo checking for ansi-style prototypes
  380. cat > conftest.c <<EOF
  381. main(int argc,char **argv){exit(0);}
  382. EOF
  383. eval $compile
  384. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  385.   DEFS="$DEFS -DHAVE_ANSI_PROTO=1"
  386. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ANSI_PROTO\${SEDdB}HAVE_ANSI_PROTO\${SEDdC}1\${SEDdD}
  387. \${SEDuA}HAVE_ANSI_PROTO\${SEDuB}HAVE_ANSI_PROTO\${SEDuC}1\${SEDuD}
  388. \${SEDeA}HAVE_ANSI_PROTO\${SEDeB}HAVE_ANSI_PROTO\${SEDeC}1\${SEDeD}
  389. "
  390. fi
  391. rm -f conftest*
  392. if test -n "$GCC"; then
  393. DEFS="$DEFS -DHAVE_ANSI_PROTO=1"
  394. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ANSI_PROTO\${SEDdB}HAVE_ANSI_PROTO\${SEDdC}1\${SEDdD}
  395. \${SEDuA}HAVE_ANSI_PROTO\${SEDuB}HAVE_ANSI_PROTO\${SEDuC}1\${SEDuD}
  396. \${SEDeA}HAVE_ANSI_PROTO\${SEDeB}HAVE_ANSI_PROTO\${SEDeC}1\${SEDeD}
  397. "
  398. fi
  399. echo checking for ANSI C header files
  400. cat > conftest.c <<EOF
  401. #include <stdlib.h>
  402. #include <stdarg.h>
  403. #include <string.h>
  404. #include <float.h>
  405. EOF
  406. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  407. if test -z "$err"; then
  408.   # SunOS string.h does not declare mem*, contrary to ANSI.
  409. echo '#include <string.h>' > conftest.c
  410. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  411. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  412.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  413. cat > conftest.c <<EOF
  414. #include <ctype.h>
  415. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  416. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  417. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  418. int main () { int i; for (i = 0; i < 256; i++)
  419. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  420. exit (0); }
  421.  
  422. EOF
  423. eval $compile
  424. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  425.   DEFS="$DEFS -DSTDC_HEADERS=1"
  426. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  427. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  428. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  429. "
  430. fi
  431. rm -f conftest*
  432. fi
  433. rm -f conftest*
  434.  
  435. fi
  436. rm -f conftest*
  437.  
  438. for hdr in string.h memory.h strings.h
  439. do
  440. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  441. echo checking for ${hdr}
  442. cat > conftest.c <<EOF
  443. #include <${hdr}>
  444. EOF
  445. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  446. if test -z "$err"; then
  447.   DEFS="$DEFS -D${trhdr}=1"
  448. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  449. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  450. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  451. "
  452. fi
  453. rm -f conftest*
  454. done
  455.  
  456. echo checking for long file names
  457. (echo 1 > conftest9012345) 2>/dev/null
  458. (echo 2 > conftest9012346) 2>/dev/null
  459. val=`cat conftest9012345 2>/dev/null`
  460. test -f conftest9012345 && test "$val" = 1 && DEFS="$DEFS -DHAVE_LONG_FILE_NAMES=1"
  461. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_FILE_NAMES\${SEDdB}HAVE_LONG_FILE_NAMES\${SEDdC}1\${SEDdD}
  462. \${SEDuA}HAVE_LONG_FILE_NAMES\${SEDuB}HAVE_LONG_FILE_NAMES\${SEDuC}1\${SEDuD}
  463. \${SEDeA}HAVE_LONG_FILE_NAMES\${SEDeB}HAVE_LONG_FILE_NAMES\${SEDeC}1\${SEDeD}
  464. "
  465. rm -f conftest9012345 conftest9012346
  466.  
  467. echo checking for word sizes
  468. cat > conftest.c <<EOF
  469.  main(){ exit(sizeof(unsigned)!=2); }
  470. EOF
  471. eval $compile
  472. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  473.   DEFS="$DEFS -DSIZE_INT_2=1"
  474. SEDDEFS="${SEDDEFS}\${SEDdA}SIZE_INT_2\${SEDdB}SIZE_INT_2\${SEDdC}1\${SEDdD}
  475. \${SEDuA}SIZE_INT_2\${SEDuB}SIZE_INT_2\${SEDuC}1\${SEDuD}
  476. \${SEDeA}SIZE_INT_2\${SEDeB}SIZE_INT_2\${SEDeC}1\${SEDeD}
  477. "
  478. fi
  479. rm -f conftest*
  480. cat > conftest.c <<EOF
  481.  main(){ exit(sizeof(unsigned)!=4); }
  482. EOF
  483. eval $compile
  484. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  485.   DEFS="$DEFS -DSIZE_INT_4=1"
  486. SEDDEFS="${SEDDEFS}\${SEDdA}SIZE_INT_4\${SEDdB}SIZE_INT_4\${SEDdC}1\${SEDdD}
  487. \${SEDuA}SIZE_INT_4\${SEDuB}SIZE_INT_4\${SEDuC}1\${SEDuD}
  488. \${SEDeA}SIZE_INT_4\${SEDeB}SIZE_INT_4\${SEDeC}1\${SEDeD}
  489. "
  490. fi
  491. rm -f conftest*
  492. cat > conftest.c <<EOF
  493.  main(){ exit(sizeof(short)!=2); }
  494. EOF
  495. eval $compile
  496. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  497.   DEFS="$DEFS -DSIZE_SRT_2=1"
  498. SEDDEFS="${SEDDEFS}\${SEDdA}SIZE_SRT_2\${SEDdB}SIZE_SRT_2\${SEDdC}1\${SEDdD}
  499. \${SEDuA}SIZE_SRT_2\${SEDuB}SIZE_SRT_2\${SEDuC}1\${SEDuD}
  500. \${SEDeA}SIZE_SRT_2\${SEDeB}SIZE_SRT_2\${SEDeC}1\${SEDeD}
  501. "
  502. fi
  503. rm -f conftest*
  504. cat > conftest.c <<EOF
  505.  main(){ exit(sizeof(long)!=4); }
  506. EOF
  507. eval $compile
  508. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  509.   DEFS="$DEFS -DSIZE_LNG_4=1"
  510. SEDDEFS="${SEDDEFS}\${SEDdA}SIZE_LNG_4\${SEDdB}SIZE_LNG_4\${SEDdC}1\${SEDdD}
  511. \${SEDuA}SIZE_LNG_4\${SEDuB}SIZE_LNG_4\${SEDuC}1\${SEDuD}
  512. \${SEDeA}SIZE_LNG_4\${SEDeB}SIZE_LNG_4\${SEDeC}1\${SEDeD}
  513. "
  514. fi
  515. rm -f conftest*
  516. echo checking for unistd.h
  517. cat > conftest.c <<EOF
  518. #include <unistd.h>
  519. EOF
  520. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  521. if test -z "$err"; then
  522.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  523. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNISTD_H\${SEDdB}HAVE_UNISTD_H\${SEDdC}1\${SEDdD}
  524. \${SEDuA}HAVE_UNISTD_H\${SEDuB}HAVE_UNISTD_H\${SEDuC}1\${SEDuD}
  525. \${SEDeA}HAVE_UNISTD_H\${SEDeB}HAVE_UNISTD_H\${SEDeC}1\${SEDeD}
  526. "
  527. fi
  528. rm -f conftest*
  529.  
  530. echo checking for mode_t in sys/types.h
  531. echo '#include <sys/types.h>' > conftest.c
  532. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  533. if grep "mode_t" conftest.out >/dev/null 2>&1; then
  534.   :
  535. else 
  536.   DEFS="$DEFS -Dmode_t=int"
  537. SEDDEFS="${SEDDEFS}\${SEDdA}mode_t\${SEDdB}mode_t\${SEDdC}int\${SEDdD}
  538. \${SEDuA}mode_t\${SEDuB}mode_t\${SEDuC}int\${SEDuD}
  539. \${SEDeA}mode_t\${SEDeB}mode_t\${SEDeC}int\${SEDeD}
  540. "
  541. fi
  542. rm -f conftest*
  543.  
  544. echo checking for pid_t in sys/types.h
  545. echo '#include <sys/types.h>' > conftest.c
  546. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  547. if grep "pid_t" conftest.out >/dev/null 2>&1; then
  548.   :
  549. else 
  550.   DEFS="$DEFS -Dpid_t=int"
  551. SEDDEFS="${SEDDEFS}\${SEDdA}pid_t\${SEDdB}pid_t\${SEDdC}int\${SEDdD}
  552. \${SEDuA}pid_t\${SEDuB}pid_t\${SEDuC}int\${SEDuD}
  553. \${SEDeA}pid_t\${SEDeB}pid_t\${SEDeC}int\${SEDeD}
  554. "
  555. fi
  556. rm -f conftest*
  557.  
  558. echo checking for size_t in sys/types.h
  559. echo '#include <sys/types.h>' > conftest.c
  560. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  561. if grep "size_t" conftest.out >/dev/null 2>&1; then
  562.   :
  563. else 
  564.   DEFS="$DEFS -Dsize_t=unsigned"
  565. SEDDEFS="${SEDDEFS}\${SEDdA}size_t\${SEDdB}size_t\${SEDdC}unsigned\${SEDdD}
  566. \${SEDuA}size_t\${SEDuB}size_t\${SEDuC}unsigned\${SEDuD}
  567. \${SEDeA}size_t\${SEDeB}size_t\${SEDeC}unsigned\${SEDeD}
  568. "
  569. fi
  570. rm -f conftest*
  571.  
  572. echo checking for uid_t in sys/types.h
  573. echo '#include <sys/types.h>' > conftest.c
  574. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  575. if grep "uid_t" conftest.out >/dev/null 2>&1; then
  576.   :
  577. else 
  578.   DEFS="$DEFS -Duid_t=int"
  579. SEDDEFS="${SEDDEFS}\${SEDdA}uid_t\${SEDdB}uid_t\${SEDdC}int\${SEDdD}
  580. \${SEDuA}uid_t\${SEDuB}uid_t\${SEDuC}int\${SEDuD}
  581. \${SEDeA}uid_t\${SEDeB}uid_t\${SEDeC}int\${SEDeD}
  582. " DEFS="$DEFS -Dgid_t=int"
  583. SEDDEFS="${SEDDEFS}\${SEDdA}gid_t\${SEDdB}gid_t\${SEDdC}int\${SEDdD}
  584. \${SEDuA}gid_t\${SEDuB}gid_t\${SEDuC}int\${SEDuD}
  585. \${SEDeA}gid_t\${SEDeB}gid_t\${SEDeC}int\${SEDeD}
  586. "
  587. fi
  588. rm -f conftest*
  589.  
  590. echo checking for nlink_t in sys/types.h
  591. echo '#include <sys/types.h>' > conftest.c
  592. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  593. if grep "nlink_t" conftest.out >/dev/null 2>&1; then
  594.   :
  595. else 
  596.   DEFS="$DEFS -Dnlink_t=int"
  597. SEDDEFS="${SEDDEFS}\${SEDdA}nlink_t\${SEDdB}nlink_t\${SEDdC}int\${SEDdD}
  598. \${SEDuA}nlink_t\${SEDuB}nlink_t\${SEDuC}int\${SEDuD}
  599. \${SEDeA}nlink_t\${SEDeB}nlink_t\${SEDeC}int\${SEDeD}
  600. "
  601. fi
  602. rm -f conftest*
  603.  
  604. echo checking for bsearch 
  605. cat > conftest.c <<EOF
  606. #include <stdio.h>
  607. main() { exit(0); } 
  608. t() { 
  609. #ifdef __stub_bsearch 
  610. choke me
  611. #else
  612. /* Override any gcc2 internal prototype to avoid an error.  */
  613. extern char bsearch (); bsearch ();
  614. #endif
  615.  }
  616. EOF
  617. if eval $compile; then
  618.   :
  619. else
  620.   DEFS="$DEFS -Dbsearch=ansi_bsearch"
  621. SEDDEFS="${SEDDEFS}\${SEDdA}bsearch\${SEDdB}bsearch\${SEDdC}ansi_bsearch\${SEDdD}
  622. \${SEDuA}bsearch\${SEDuB}bsearch\${SEDuC}ansi_bsearch\${SEDuD}
  623. \${SEDeA}bsearch\${SEDeB}bsearch\${SEDeC}ansi_bsearch\${SEDeD}
  624. "
  625. fi
  626. rm -f conftest*
  627. #endif
  628.  
  629. echo checking for random 
  630. cat > conftest.c <<EOF
  631. #include <stdio.h>
  632. main() { exit(0); } 
  633. t() { 
  634. #ifdef __stub_random 
  635. choke me
  636. #else
  637. /* Override any gcc2 internal prototype to avoid an error.  */
  638. extern char random (); random ();
  639. #endif
  640.  }
  641. EOF
  642. if eval $compile; then
  643.   :
  644. else
  645.   DEFS="$DEFS -DNEED_RANDOM=1"
  646. SEDDEFS="${SEDDEFS}\${SEDdA}NEED_RANDOM\${SEDdB}NEED_RANDOM\${SEDdC}1\${SEDdD}
  647. \${SEDuA}NEED_RANDOM\${SEDuB}NEED_RANDOM\${SEDuC}1\${SEDuD}
  648. \${SEDeA}NEED_RANDOM\${SEDeB}NEED_RANDOM\${SEDeC}1\${SEDeD}
  649. "
  650. fi
  651. rm -f conftest*
  652. #endif
  653.  
  654. echo checking for strdup
  655. cat > conftest.c <<EOF
  656. #include <stdio.h>
  657. main() { exit(0); } 
  658. t() { 
  659. #ifdef __stub_strdup
  660. choke me
  661. #else
  662. /* Override any gcc2 internal prototype to avoid an error.  */
  663. extern char strdup(); strdup();
  664. #endif
  665.  }
  666. EOF
  667. if eval $compile; then
  668.   :
  669. else
  670.   DEFS="$DEFS -DNEED_STRDUP=1"
  671. SEDDEFS="${SEDDEFS}\${SEDdA}NEED_STRDUP\${SEDdB}NEED_STRDUP\${SEDdC}1\${SEDdD}
  672. \${SEDuA}NEED_STRDUP\${SEDuB}NEED_STRDUP\${SEDuC}1\${SEDuD}
  673. \${SEDeA}NEED_STRDUP\${SEDeB}NEED_STRDUP\${SEDeC}1\${SEDeD}
  674. "
  675. fi
  676. rm -f conftest*
  677. #endif
  678.  
  679. echo checking for bcopy
  680. cat > conftest.c <<EOF
  681. #include <stdio.h>
  682. main() { exit(0); } 
  683. t() { 
  684. #ifdef __stub_bcopy
  685. choke me
  686. #else
  687. /* Override any gcc2 internal prototype to avoid an error.  */
  688. extern char bcopy(); bcopy();
  689. #endif
  690.  }
  691. EOF
  692. if eval $compile; then
  693.   :
  694. else
  695.   DEFS="$DEFS -DNEED_BCOPY=1"
  696. SEDDEFS="${SEDDEFS}\${SEDdA}NEED_BCOPY\${SEDdB}NEED_BCOPY\${SEDdC}1\${SEDdD}
  697. \${SEDuA}NEED_BCOPY\${SEDuB}NEED_BCOPY\${SEDuC}1\${SEDuD}
  698. \${SEDeA}NEED_BCOPY\${SEDeB}NEED_BCOPY\${SEDeC}1\${SEDeD}
  699. "
  700. fi
  701. rm -f conftest*
  702. #endif
  703.  
  704. echo checking for flock
  705. cat > conftest.c <<EOF
  706. #include <stdio.h>
  707. main() { exit(0); } 
  708. t() { 
  709. #ifdef __stub_flock
  710. choke me
  711. #else
  712. /* Override any gcc2 internal prototype to avoid an error.  */
  713. extern char flock(); flock();
  714. #endif
  715.  }
  716. EOF
  717. if eval $compile; then
  718.   DEFS="$DEFS -DHAVE_FLOCK=1"
  719. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_FLOCK\${SEDdB}HAVE_FLOCK\${SEDdC}1\${SEDdD}
  720. \${SEDuA}HAVE_FLOCK\${SEDuB}HAVE_FLOCK\${SEDuC}1\${SEDuD}
  721. \${SEDeA}HAVE_FLOCK\${SEDeB}HAVE_FLOCK\${SEDeC}1\${SEDeD}
  722. "
  723. fi
  724. rm -f conftest*
  725. #endif
  726.  
  727. echo checking for lockf
  728. cat > conftest.c <<EOF
  729. #include <stdio.h>
  730. main() { exit(0); } 
  731. t() { 
  732. #ifdef __stub_lockf
  733. choke me
  734. #else
  735. /* Override any gcc2 internal prototype to avoid an error.  */
  736. extern char lockf(); lockf();
  737. #endif
  738.  }
  739. EOF
  740. if eval $compile; then
  741.   DEFS="$DEFS -DHAVE_LOCKF=1"
  742. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LOCKF\${SEDdB}HAVE_LOCKF\${SEDdC}1\${SEDdD}
  743. \${SEDuA}HAVE_LOCKF\${SEDuB}HAVE_LOCKF\${SEDuC}1\${SEDuD}
  744. \${SEDeA}HAVE_LOCKF\${SEDeB}HAVE_LOCKF\${SEDeC}1\${SEDeD}
  745. "
  746. fi
  747. rm -f conftest*
  748. #endif
  749.  
  750. echo checking for shmget
  751. LOCKPATH="conftestlock"
  752. cat > conftest.c <<EOF
  753.  
  754. #include <sys/types.h>
  755. #include <fcntl.h>
  756. #include <sys/ipc.h>
  757. #include <sys/shm.h>
  758. #define LOCKPATH "$LOCKPATH"
  759.  
  760. main() {
  761.   key_t ky;
  762.   int   sh, rv, fd;
  763.  
  764.   fd = open(LOCKPATH, O_RDWR | O_CREAT, 0666);
  765.   if (fd == -1) exit(1);
  766.   rv = 0;
  767.   ky = ftok(LOCKPATH, 2001);
  768.   if (ky == (key_t) -1) rv = 1;
  769.   else {
  770.     struct shmid_ds foo;
  771.     sh = shmget(ky, 1, IPC_CREAT | 0666);
  772.     if (sh == -1) rv = 1;
  773.     else shmctl(sh, IPC_RMID, &foo);
  774.   }
  775.   close(fd);
  776.   exit(rv); }
  777. EOF
  778. eval $compile
  779. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  780.   DEFS="$DEFS -DHAVE_SHMEM=1"
  781. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_SHMEM\${SEDdB}HAVE_SHMEM\${SEDdC}1\${SEDdD}
  782. \${SEDuA}HAVE_SHMEM\${SEDuB}HAVE_SHMEM\${SEDuC}1\${SEDuD}
  783. \${SEDeA}HAVE_SHMEM\${SEDeB}HAVE_SHMEM\${SEDeC}1\${SEDeD}
  784. "
  785. fi
  786. rm -f conftest*
  787. rm -f $LOCKPATH conftest.c
  788. echo checking for d_ino
  789. cat > conftest.c <<EOF
  790. #ifdef DIRENT
  791. #include <dirent.h>
  792. #else
  793. #ifdef SYSDIR
  794. #include <sys/dir.h>
  795. #else
  796. #ifdef SYSNDIR
  797. #include <sys/ndir.h>
  798. #endif
  799. #endif
  800. #endif
  801. main() { exit(0); } 
  802. t() { 
  803. #ifdef DIRENT
  804. struct dirent *dp;
  805. #else
  806. struct direct *dp;
  807. #endif
  808. int a ; a=dp->d_ino; }
  809. EOF
  810. if eval $compile; then
  811.   DEFS="$DEFS -DHAVE_D_INO=1"
  812. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_D_INO\${SEDdB}HAVE_D_INO\${SEDdC}1\${SEDdD}
  813. \${SEDuA}HAVE_D_INO\${SEDuB}HAVE_D_INO\${SEDuC}1\${SEDuD}
  814. \${SEDeA}HAVE_D_INO\${SEDeB}HAVE_D_INO\${SEDeC}1\${SEDeD}
  815. "
  816. fi
  817. rm -f conftest*
  818.  
  819. echo checking for d_fileno
  820. cat > conftest.c <<EOF
  821. #ifdef DIRENT
  822. #include <dirent.h>
  823. #else
  824. #ifdef SYSDIR
  825. #include <sys/dir.h>
  826. #else
  827. #ifdef SYSNDIR
  828. #include <sys/ndir.h>
  829. #endif
  830. #endif
  831. #endif
  832. main() { exit(0); } 
  833. t() { 
  834. #ifdef DIRENT
  835. struct dirent *dp;
  836. #else
  837. struct direct *dp;
  838. #endif
  839. int a ; a=dp->d_fileno; }
  840. EOF
  841. if eval $compile; then
  842.   DEFS="$DEFS -DHAVE_D_FILENO=1"
  843. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_D_FILENO\${SEDdB}HAVE_D_FILENO\${SEDdC}1\${SEDdD}
  844. \${SEDuA}HAVE_D_FILENO\${SEDuB}HAVE_D_FILENO\${SEDuC}1\${SEDuD}
  845. \${SEDeA}HAVE_D_FILENO\${SEDeB}HAVE_D_FILENO\${SEDeC}1\${SEDeD}
  846. "
  847. fi
  848. rm -f conftest*
  849.  
  850. if test -z "$DGUX"; then
  851. echo checking for union wait
  852. cat > conftest.c <<EOF
  853. #include <sys/types.h>
  854. #include <sys/wait.h>
  855.  
  856. main() { exit(0); } 
  857. t() { union wait u ;  }
  858. EOF
  859. if eval $compile; then
  860.   DEFS="$DEFS -DHAVE_UNION_WAIT=1"
  861. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNION_WAIT\${SEDdB}HAVE_UNION_WAIT\${SEDdC}1\${SEDdD}
  862. \${SEDuA}HAVE_UNION_WAIT\${SEDuB}HAVE_UNION_WAIT\${SEDuC}1\${SEDuD}
  863. \${SEDeA}HAVE_UNION_WAIT\${SEDeB}HAVE_UNION_WAIT\${SEDeC}1\${SEDeD}
  864. "
  865. fi
  866. rm -f conftest*
  867.  
  868. fi
  869. echo checking for WEXITSTATUS
  870. cat > conftest.c <<EOF
  871. #ifdef HAVE_UNISTD_H
  872. #ifndef __hpux
  873. #include <unistd.h>
  874. #endif
  875. #endif
  876. #include <sys/types.h>
  877. #include <sys/wait.h>
  878. main() { exit(0); } 
  879. t() { 
  880. #if defined(HAVE_UNION_WAIT) && !defined(__hpux)
  881. union wait foo;
  882. #else
  883. int foo;
  884. #endif
  885. WEXITSTATUS(foo); }
  886. EOF
  887. if eval $compile; then
  888.   DEFS="$DEFS -DHAVE_WEXITSTATUS=1"
  889. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_WEXITSTATUS\${SEDdB}HAVE_WEXITSTATUS\${SEDdC}1\${SEDdD}
  890. \${SEDuA}HAVE_WEXITSTATUS\${SEDuB}HAVE_WEXITSTATUS\${SEDuC}1\${SEDuD}
  891. \${SEDeA}HAVE_WEXITSTATUS\${SEDeB}HAVE_WEXITSTATUS\${SEDeC}1\${SEDeD}
  892. "
  893. fi
  894. rm -f conftest*
  895.  
  896. echo checking for S_ISREG
  897. cat > conftest.c <<EOF
  898. #include <sys/types.h>
  899. #include <sys/stat.h>
  900. main() { exit(0); } 
  901. t() { struct stat sb; return S_ISREG(sb.st_mode); }
  902. EOF
  903. if eval $compile; then
  904.   DEFS="$DEFS -DHAVE_S_ISREG=1"
  905. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_S_ISREG\${SEDdB}HAVE_S_ISREG\${SEDdC}1\${SEDdD}
  906. \${SEDuA}HAVE_S_ISREG\${SEDuB}HAVE_S_ISREG\${SEDuC}1\${SEDuD}
  907. \${SEDeA}HAVE_S_ISREG\${SEDeB}HAVE_S_ISREG\${SEDeC}1\${SEDeD}
  908. "
  909. fi
  910. rm -f conftest*
  911.  
  912. echo checking for S_ISDIR
  913. cat > conftest.c <<EOF
  914. #include <sys/types.h>
  915. #include <sys/stat.h>
  916. main() { exit(0); } 
  917. t() { struct stat sb; return S_ISDIR(sb.st_mode); }
  918. EOF
  919. if eval $compile; then
  920.   DEFS="$DEFS -DHAVE_S_ISDIR=1"
  921. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_S_ISDIR\${SEDdB}HAVE_S_ISDIR\${SEDdC}1\${SEDdD}
  922. \${SEDuA}HAVE_S_ISDIR\${SEDuB}HAVE_S_ISDIR\${SEDuC}1\${SEDuD}
  923. \${SEDeA}HAVE_S_ISDIR\${SEDeB}HAVE_S_ISDIR\${SEDeC}1\${SEDeD}
  924. "
  925. fi
  926. rm -f conftest*
  927.  
  928. echo checking for tzfile.h
  929. cat > conftest.c <<EOF
  930. #include <tzfile.h>
  931. EOF
  932. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  933. if test -z "$err"; then
  934.   TZFILE_H=1
  935. DEFS="$DEFS -DHAVE_TZFILE_H=1"
  936. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TZFILE_H\${SEDdB}HAVE_TZFILE_H\${SEDdC}1\${SEDdD}
  937. \${SEDuA}HAVE_TZFILE_H\${SEDuB}HAVE_TZFILE_H\${SEDuC}1\${SEDuD}
  938. \${SEDeA}HAVE_TZFILE_H\${SEDeB}HAVE_TZFILE_H\${SEDeC}1\${SEDeD}
  939. "
  940. else
  941.   DEFS="$DEFS -D'USE_SECSPERDAY=(long)60*60*24'"
  942. SEDDEFS="${SEDDEFS}\${SEDdA}USE_SECSPERDAY\${SEDdB}USE_SECSPERDAY\${SEDdC}(long)60*60*24\${SEDdD}
  943. \${SEDuA}USE_SECSPERDAY\${SEDuB}USE_SECSPERDAY\${SEDuC}(long)60*60*24\${SEDuD}
  944. \${SEDeA}USE_SECSPERDAY\${SEDeB}USE_SECSPERDAY\${SEDeC}(long)60*60*24\${SEDeD}
  945. "
  946.          DEFS="$DEFS -DUSE_DAYSPERNYEAR=365"
  947. SEDDEFS="${SEDDEFS}\${SEDdA}USE_DAYSPERNYEAR\${SEDdB}USE_DAYSPERNYEAR\${SEDdC}365\${SEDdD}
  948. \${SEDuA}USE_DAYSPERNYEAR\${SEDuB}USE_DAYSPERNYEAR\${SEDuC}365\${SEDuD}
  949. \${SEDeA}USE_DAYSPERNYEAR\${SEDeB}USE_DAYSPERNYEAR\${SEDeC}365\${SEDeD}
  950. "
  951. fi
  952. rm -f conftest*
  953.  
  954. if test -n "$TZFILE_H"; then
  955. echo checking for SECSPERDAY
  956. cat > conftest.c <<EOF
  957. #include <tzfile.h>
  958. main() { exit(0); } 
  959. t() { long b = SECSPERDAY; }
  960. EOF
  961. if eval $compile; then
  962.   DEFS="$DEFS -DHAVE_SECSPERDAY=1"
  963. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_SECSPERDAY\${SEDdB}HAVE_SECSPERDAY\${SEDdC}1\${SEDdD}
  964. \${SEDuA}HAVE_SECSPERDAY\${SEDuB}HAVE_SECSPERDAY\${SEDuC}1\${SEDuD}
  965. \${SEDeA}HAVE_SECSPERDAY\${SEDeB}HAVE_SECSPERDAY\${SEDeC}1\${SEDeD}
  966. "
  967. else
  968.   echo checking for SECS_PER_DAY
  969. cat > conftest.c <<EOF
  970. #include <tzfile.h>
  971. main() { exit(0); } 
  972. t() { long b = SECS_PER_DAY; }
  973. EOF
  974. if eval $compile; then
  975.   DEFS="$DEFS -DUSE_SECSPERDAY=SECS_PER_DAY"
  976. SEDDEFS="${SEDDEFS}\${SEDdA}USE_SECSPERDAY\${SEDdB}USE_SECSPERDAY\${SEDdC}SECS_PER_DAY\${SEDdD}
  977. \${SEDuA}USE_SECSPERDAY\${SEDuB}USE_SECSPERDAY\${SEDuC}SECS_PER_DAY\${SEDuD}
  978. \${SEDeA}USE_SECSPERDAY\${SEDeB}USE_SECSPERDAY\${SEDeC}SECS_PER_DAY\${SEDeD}
  979. "
  980. else
  981.   DEFS="$DEFS -D'USE_SECSPERDAY=(long)60*60*24'"
  982. SEDDEFS="${SEDDEFS}\${SEDdA}USE_SECSPERDAY\${SEDdB}USE_SECSPERDAY\${SEDdC}(long)60*60*24\${SEDdD}
  983. \${SEDuA}USE_SECSPERDAY\${SEDuB}USE_SECSPERDAY\${SEDuC}(long)60*60*24\${SEDuD}
  984. \${SEDeA}USE_SECSPERDAY\${SEDeB}USE_SECSPERDAY\${SEDeC}(long)60*60*24\${SEDeD}
  985. "
  986. fi
  987. rm -f conftest*
  988.  
  989. fi
  990. rm -f conftest*
  991.  
  992. echo checking for DAYSPERNYEAR
  993. cat > conftest.c <<EOF
  994. #include <tzfile.h>
  995. main() { exit(0); } 
  996. t() { int b = DAYSPERNYEAR; }
  997. EOF
  998. if eval $compile; then
  999.   DEFS="$DEFS -DHAVE_DAYSPERNYEAR=1"
  1000. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DAYSPERNYEAR\${SEDdB}HAVE_DAYSPERNYEAR\${SEDdC}1\${SEDdD}
  1001. \${SEDuA}HAVE_DAYSPERNYEAR\${SEDuB}HAVE_DAYSPERNYEAR\${SEDuC}1\${SEDuD}
  1002. \${SEDeA}HAVE_DAYSPERNYEAR\${SEDeB}HAVE_DAYSPERNYEAR\${SEDeC}1\${SEDeD}
  1003. "
  1004. else
  1005.   echo checking for DAYS_PER_NYEAR
  1006. cat > conftest.c <<EOF
  1007. #include <tzfile.h>
  1008. main() { exit(0); } 
  1009. t() { int b = DAYS_PER_NYEAR; }
  1010. EOF
  1011. if eval $compile; then
  1012.   DEFS="$DEFS -DUSE_DAYSPERNYEAR=DAYS_PER_NYEAR"
  1013. SEDDEFS="${SEDDEFS}\${SEDdA}USE_DAYSPERNYEAR\${SEDdB}USE_DAYSPERNYEAR\${SEDdC}DAYS_PER_NYEAR\${SEDdD}
  1014. \${SEDuA}USE_DAYSPERNYEAR\${SEDuB}USE_DAYSPERNYEAR\${SEDuC}DAYS_PER_NYEAR\${SEDuD}
  1015. \${SEDeA}USE_DAYSPERNYEAR\${SEDeB}USE_DAYSPERNYEAR\${SEDeC}DAYS_PER_NYEAR\${SEDeD}
  1016. "
  1017. else
  1018.   DEFS="$DEFS -DUSE_DAYSPERNYEAR=365"
  1019. SEDDEFS="${SEDDEFS}\${SEDdA}USE_DAYSPERNYEAR\${SEDdB}USE_DAYSPERNYEAR\${SEDdC}365\${SEDdD}
  1020. \${SEDuA}USE_DAYSPERNYEAR\${SEDuB}USE_DAYSPERNYEAR\${SEDuC}365\${SEDuD}
  1021. \${SEDeA}USE_DAYSPERNYEAR\${SEDeB}USE_DAYSPERNYEAR\${SEDeC}365\${SEDeD}
  1022. "
  1023. fi
  1024. rm -f conftest*
  1025.  
  1026. fi
  1027. rm -f conftest*
  1028.  
  1029. fi
  1030. echo checking for string.h declaring some functions incorrectly
  1031. echo "$DEFS
  1032. #include <sys/types.h>
  1033. #include <string.h>
  1034. " > conftest.c
  1035. $CC conftest.c -o conftest $LIBS > conftest.out 2>&1
  1036. if grep "conflicting types for built-in function" conftest.out >/dev/null; then DEFS="$DEFS -DSTRING_H_BOGUS=1"
  1037. SEDDEFS="${SEDDEFS}\${SEDdA}STRING_H_BOGUS\${SEDdB}STRING_H_BOGUS\${SEDdC}1\${SEDdD}
  1038. \${SEDuA}STRING_H_BOGUS\${SEDuB}STRING_H_BOGUS\${SEDuC}1\${SEDuD}
  1039. \${SEDeA}STRING_H_BOGUS\${SEDeB}STRING_H_BOGUS\${SEDeC}1\${SEDeD}
  1040. "
  1041. fi
  1042. rm -f conftest*
  1043. echo checking for vprintf
  1044. cat > conftest.c <<EOF
  1045.  
  1046. main() { exit(0); } 
  1047. t() { vprintf(); }
  1048. EOF
  1049. if eval $compile; then
  1050.   DEFS="$DEFS -DHAVE_VPRINTF=1"
  1051. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VPRINTF\${SEDdB}HAVE_VPRINTF\${SEDdC}1\${SEDdD}
  1052. \${SEDuA}HAVE_VPRINTF\${SEDuB}HAVE_VPRINTF\${SEDuC}1\${SEDuD}
  1053. \${SEDeA}HAVE_VPRINTF\${SEDeB}HAVE_VPRINTF\${SEDeC}1\${SEDeD}
  1054. "
  1055. else
  1056.   vprintf_missing=1
  1057. fi
  1058. rm -f conftest*
  1059.  
  1060. if test -n "$vprintf_missing"; then
  1061. echo checking for _doprnt
  1062. cat > conftest.c <<EOF
  1063.  
  1064. main() { exit(0); } 
  1065. t() { _doprnt(); }
  1066. EOF
  1067. if eval $compile; then
  1068.   DEFS="$DEFS -DHAVE_DOPRNT=1"
  1069. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DOPRNT\${SEDdB}HAVE_DOPRNT\${SEDdC}1\${SEDdD}
  1070. \${SEDuA}HAVE_DOPRNT\${SEDuB}HAVE_DOPRNT\${SEDuC}1\${SEDuD}
  1071. \${SEDeA}HAVE_DOPRNT\${SEDeB}HAVE_DOPRNT\${SEDeC}1\${SEDeD}
  1072. "
  1073. fi
  1074. rm -f conftest*
  1075.  
  1076. fi
  1077.  
  1078. if test -z "$GCC"; then
  1079.   prog='/* Ultrix mips cc rejects this.  */
  1080. typedef int charset[2]; const charset x;
  1081. /* SunOS 4.1.1 cc rejects this. */
  1082. char const *const *p;
  1083. char **p2;
  1084. /* HPUX 7.0 cc rejects these. */
  1085. ++p;
  1086. p2 = (char const* const*) p;'
  1087. echo checking for working const
  1088. cat > conftest.c <<EOF
  1089.  
  1090. main() { exit(0); } 
  1091. t() { $prog }
  1092. EOF
  1093. if eval $compile; then
  1094.   :
  1095. else
  1096.   DEFS="$DEFS -Dconst="
  1097. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  1098. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  1099. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  1100. "
  1101. fi
  1102. rm -f conftest*
  1103.  
  1104. fi
  1105. if test -n "$prefix"; then
  1106.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  1107.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  1108. fi
  1109. if test -n "$exec_prefix"; then
  1110.   prsub="$prsub
  1111. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  1112. exec_prefix\\1=\\2$exec_prefix%"
  1113. fi
  1114.  
  1115. trap 'rm -f config.status; exit 1' 1 3 15
  1116. echo creating config.status
  1117. rm -f config.status
  1118. cat > config.status <<EOF
  1119. #!/bin/sh
  1120. # Generated automatically by configure.
  1121. # Run this file to recreate the current configuration.
  1122. # This directory was configured as follows,
  1123. # on host `(hostname || uname -n) 2>/dev/null`:
  1124. #
  1125. # $0 $*
  1126.  
  1127. for arg
  1128. do
  1129.   case "\$arg" in
  1130.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1131.     exec /bin/sh $0 $* ;;
  1132.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  1133.   esac
  1134. done
  1135.  
  1136. trap 'rm -f Makefile include/tweak.h conftest*; exit 1' 1 3 15
  1137. LN_S='$LN_S'
  1138. CC='$CC'
  1139. CPP='$CPP'
  1140. EX_LIBS='$EX_LIBS'
  1141. PARALLEL_MAKE='$PARALLEL_MAKE'
  1142. INSTALL='$INSTALL'
  1143. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1144. INSTALL_DATA='$INSTALL_DATA'
  1145. RANLIB='$RANLIB'
  1146. LIBS='$LIBS'
  1147. srcdir='$srcdir'
  1148. prefix='$prefix'
  1149. exec_prefix='$exec_prefix'
  1150. prsub='$prsub'
  1151. EOF
  1152. cat >> config.status <<\EOF
  1153.  
  1154. top_srcdir=$srcdir
  1155. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  1156.   srcdir=$top_srcdir
  1157.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1158.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1159.   if test "$dir" != "$file"; then
  1160.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1161.     test ! -d $dir && mkdir $dir
  1162.   fi
  1163.   echo creating $file
  1164.   rm -f $file
  1165.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1166.   sed -e "
  1167. $prsub
  1168. s%@LN_S@%$LN_S%g
  1169. s%@CC@%$CC%g
  1170. s%@CPP@%$CPP%g
  1171. s%@EX_LIBS@%$EX_LIBS%g
  1172. s%@PARALLEL_MAKE@%$PARALLEL_MAKE%g
  1173. s%@INSTALL@%$INSTALL%g
  1174. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1175. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1176. s%@RANLIB@%$RANLIB%g
  1177. s%@LIBS@%$LIBS%g
  1178. s%@srcdir@%$srcdir%g
  1179. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  1180. fi; done
  1181.  
  1182. echo creating include/tweak.h
  1183. # These sed commands are put into SEDDEFS when defining a macro.
  1184. # They are broken into pieces to make the sed script easier to manage.
  1185. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  1186. # is the cpp macro being defined and VALUE is the value it is being given.
  1187. # Each defining turns into a single global substitution command.
  1188. #
  1189. # SEDd sets the value in "#define NAME VALUE" lines.
  1190. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1191. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  1192. SEDdC='\3'
  1193. SEDdD='@g'
  1194. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1195. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1196. SEDuB='\([     ]\)@\1#\2define\3'
  1197. SEDuC=' '
  1198. SEDuD='\4@g'
  1199. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1200. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1201. SEDeB='$@\1#\2define\3'
  1202. SEDeC=' '
  1203. SEDeD='@g'
  1204. rm -f conftest.sed
  1205. cat > conftest.sed <<CONFEOF
  1206. EOF
  1207. # Turn off quoting long enough to insert the sed commands.
  1208. cat >> config.status <<EOF
  1209. $SEDDEFS
  1210. EOF
  1211. cat >> config.status <<\EOF
  1212. CONFEOF
  1213. rm -f conftest.h
  1214. # Break up the sed commands because old seds have small limits.
  1215. cp $top_srcdir/include/tweak.h.in conftest.h1
  1216. while :
  1217. do
  1218.   lines=`grep -c . conftest.sed`
  1219.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1220.   rm -f conftest.s1 conftest.s2 conftest.h2
  1221.   sed 20q conftest.sed > conftest.s1 # Like head -20.
  1222.   sed 1,20d conftest.sed > conftest.s2 # Like tail +21.
  1223.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  1224.   rm -f conftest.s1 conftest.h1 conftest.sed
  1225.   mv conftest.h2 conftest.h1
  1226.   mv conftest.s2 conftest.sed
  1227. done
  1228. rm -f conftest.sed conftest.h
  1229. echo "/* include/tweak.h.  Generated automatically by configure.  */" > conftest.h
  1230. cat conftest.h1 >> conftest.h
  1231. rm -f conftest.h1
  1232. if cmp -s include/tweak.h conftest.h 2>/dev/null; then
  1233.   # The file exists and we would not be changing it.
  1234.   rm -f conftest.h
  1235. else
  1236.   rm -f include/tweak.h
  1237.   mv conftest.h include/tweak.h
  1238. fi
  1239.  
  1240. EOF
  1241. chmod +x config.status
  1242. test -n "$no_create" || ./config.status
  1243.  
  1244.